const Router = require('@koa/router')
const mongoose = require('mongoose')

const Character = mongoose.model('Character')

const router = new Router({
    prefix: '/character',
})

router.get('/list', async (ctx) => {
    const list = await Character.find().exec()
    ctx.body = {
        data: list,
        code: 200,
        msg: '获取角色列表成功'
    }
})
module.exports = router